

import AutomaticRecode from "../../Commons/AutomaticRecode";


export default class CardEntity extends AutomaticRecode {

    public id: number;
    public isReceive: boolean;
    public receiveTime: number;
    public endTime: number;

    public get leftTime(): number {
        var num = cc.sys.now() - this.receiveTime;

        return 60 * 60 * 24 - num * 0.001;
    }
    /**
     * 
     * @returns 是否过期
     */
    public isOutDate(): boolean {
        return cc.sys.now() > this.endTime;
    }
}
